<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, minimal-ui">
		<title></title>
		<link rel="stylesheet" type="text/css" href="css/Game.css" />
		<script src="js/cookie.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			function Initialization()
			{
				var scriptsrc = "";
				var strCookie = getCookie("game");
				console.log(strCookie);
				if(strCookie==""||strCookie==null)
				{
					alert("游戏类型为空，跳转回首页");
					window.location.href = "index.html";
					return;
				}
				switch(strCookie)
				{
					case "2048":
						scriptsrc = "js/Game/2048.js";
						break;
					case "Gobang":
						scriptsrc = "js/Game/Gobang.js";
						break;
					case "Sudoku":
						scriptsrc = "js/Game/Sudoku.js";
						break;
				}
				var oHead = document.getElementsByTagName('HEAD').item(0);
				var oScript = document.createElement("script");
				oScript.type = "text/javascript";
				oScript.src = scriptsrc;
				oHead.appendChild(oScript);
				setTimeout("begin()", 1000);
			}
			function begin()
			{
				InitializationforGame();
			}
		</script>
	</head>

	<body onload="Initialization()">
		<header>
			<a href="index.html" id="returnindex">返回首页</a>
		</header>
		<section>
			<canvas id="myCanvas" onclick="inputloc(event)" onpre></canvas>
		</section>
		<audio id="music" src="video/play.mp3">你的浏览器不支持audio标签。</audio> 
	</body>

</html>